.TH std::ranges::lazy_split_view::end 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::ranges::lazy_split_view::end \- std::ranges::lazy_split_view::end

.SH Synopsis
   constexpr auto end() requires ranges::forward_range<V> &&          \fB(1)\fP \fI(since C++20)\fP
   ranges::common_range<V>;
   constexpr auto end() const;                                        \fB(2)\fP \fI(since C++20)\fP

   1) Returns an iterator representing the end of the view.

   Equivalent to:

   return /*outer_iterator*/</*simple_view*/<V>>{*this, ranges::end(base_)};.
   2) Returns an outer_iterator or a std::default_sentinel representing the end of the
   view.

   Equivalent to:

 if constexpr (ranges::forward_range<V> && ranges::forward_range<const V> &&
               ranges::common_range<const V>)
     return /*outer_iterator*/<true>{*this, ranges::end(base_)};
 else
     return std::default_sentinel;

.SH Parameters

   \fI(none)\fP

.SH Return value

   An outer_iterator or a std::default_sentinel representing the end of the view.

.SH Example


// Run this code

 #include <iostream>
 #include <ranges>
 #include <string_view>

 int main()
 {
     constexpr std::string_view keywords{ "false float for friend" };
     std::ranges::lazy_split_view kw{ keywords, ' ' };
     const auto count = std::ranges::distance(kw.begin(), kw.end());
     std::cout << "Words count: " << count << '\\n';
 }

.SH Output:

 Words count: 4

.SH See also

   begin         returns an iterator to the beginning
   (C++20)       \fI(public member function)\fP
   end           returns an iterator or a sentinel to the end
   (C++20)       \fI(public member function of std::ranges::split_view<V,Pattern>)\fP
   ranges::begin returns an iterator to the beginning of a range
   (C++20)       (customization point object)
   ranges::end   returns a sentinel indicating the end of a range
   (C++20)       (customization point object)
